/**
 * Created by Administrator on 2017/3/26.
 */
app.controller('specCtrl',
    ['$scope','$location','$routeParams','$http','$rootScope', function ($scope,$location,$routeParams,$http,$rootScope) {
        var filedId=$routeParams.fileId;
        $rootScope.speciParentColumnId=$routeParams.linkID;
        var linkID=$routeParams.linkID;
        //专题详情1头部
        console.log("filedId")
        console.log(filedId)


        // 详情头部
        $http.jsonp(specHeadData+'columnId='+linkID+'&siteId=1&jsoncallback=JSON_CALLBACK'
        ).success(function(data,header,config,status){
            console.log("头部数据");
            console.log(data);
            $scope.specHeadTitlTxt=data.description;
            $scope.specHeadImg=data.padIcon;
        });
        // 专题详情1列表

        console.log("linkId");
        console.log($rootScope.speciParentColumnId);
        $http.jsonp(DetailSpecOneData+'siteId=1&parentColumnId='+$rootScope.speciParentColumnId+'&version=0&columnType=-1&jsoncallback=JSON_CALLBACK'
        ).success(function(data,header,config,status){
            $scope.specDetaiData=data;
            $scope.specDetaiDataColumns=data.columns;
            var specDetaiDataColumns= $scope.specDetaiDataColumns;
            console.log("专题详情");
            console.log($scope.specDetaiData);

            // 详情1具体内容
            $scope.DetailSpecContData=[];
            // $scope.childDetailSec=[];
            for(let i=0;i<specDetaiDataColumns.length;i++){

                $scope.DetailSpecContData[i]=[];
                $http.jsonp(specDetailOneConten+'columnId='+specDetaiDataColumns[i].columnId+'&lastFileId=0&count=30&rowNumber=0&version=0&adv=1&jsoncallback=JSON_CALLBACK'
                ).success(function(datas,header,config,status){
                    $scope.DetailSpecContData[i].push(datas);
                }).error(function(data,header,config,status){
                });

            }
            console.log("内容")
            console.log($scope.DetailSpecContData);

        }).error(function(data,header,config,status){
        });

    }]);
